package com.seveneight.baijiesteward.ui.user.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.RankBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.user.contract.GetRankListContract;
import com.seveneight.baijiesteward.ui.user.model.GetRankListModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/3/24.
 */

public class GetRankListPresenter implements GetRankListContract.GetRankListPresenter {

    GetRankListContract.GetRankListView getRankListView;
    GetRankListContract.GetRankListModel getRankListModel;

    public GetRankListPresenter(GetRankListContract.GetRankListView getRankListView) {
        this.getRankListView = getRankListView;
        getRankListModel = new GetRankListModel();
    }

    @Override
    public void getRankList(Context context, RequestBody body) {
        getRankListModel.getRankList(context,body, new MyCallBack<List<RankBean>>() {
            @Override
            public void onSuccess(List<RankBean> rankBeans) {
                getRankListView.reBackRankData(rankBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
